import sys
from socket import *

if len(sys.argv)!=2:
    quit()



HOST,PORT='localhost',int(sys.argv[1])
while 1 :
	text=raw_input("Tape\n")+"\n"
	s=socket(AF_INET,SOCK_STREAM)
	s.connect((HOST,PORT))
	s.send(text)
	print "Received from server \n", s.recv(2024)
	s.close()
